import { Column, CreateDateColumn, DeleteDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";

@Entity('borrow_tb')
export class Borrow {
    @PrimaryGeneratedColumn({comment:'记录id'})
    id:number;
    @Column({comment:'借阅人名称'})
    user_name: string;
    @Column({comment:'借书证号'})
    card_id: string;
    @Column({comment:'联系电话'})
    phone: string;
    @Column({ default: null, comment:'借阅时间'})
    borrow_date: Date;
    @Column({ default: null, comment:'归还时间'})
    return_date: Date;
    @Column({ default: null, comment:'实际归还时间'})
    actual_return_date: Date;
    @Column({default: 0, comment:'借阅状态 0 再借 1 已归还 2 逾期'})
    status: number;
    @Column({ comment: '图书编号'})
    book_id: number; 
    @Column({ comment: '图书类型'})
    category_id: number;
    @CreateDateColumn({ name: 'create_time', comment:'创建时间' })
    create_time:Date;
    @UpdateDateColumn({ name: 'update_time',  comment:'更新时间' })
    update_time:Date;
    @Column({select: false})
    @DeleteDateColumn({ select: false, name: 'delete_time', comment:'删除时间' })
    delete_time:Date;
}
